package android.slc.user.ui;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.slc.appbase.ui.activity.base.AppMvvmBaseToolBarActivity;
import android.slc.user.R;
import android.slc.user.databinding.UserActivityUserInfoBinding;

import androidx.annotation.Nullable;

/**
 * @author slc
 * @date 2020-07-28 15:47
 */
public class UserInfoActivity extends AppMvvmBaseToolBarActivity<UserActivityUserInfoBinding,UserInfoVm> {

    public static void show(Context context) {
        Intent intent = new Intent(context, UserInfoActivity.class);
        context.startActivity(intent);
    }

    @Override
    public Object setContentView() {
        return R.layout.user_activity_user_info;
    }

    @Override
    public void onBindViewLater() {
        super.onBindViewLater();
        getDataBinding().setVm(viewModel);
    }

    @Override
    public void onBindView(@Nullable Bundle savedInstanceState) {
        super.onBindView(savedInstanceState);
        mSlcToolbar.setTitle(R.string.app_label_personal_information);
        mSlcToolbar.inflateMenu(R.menu.user_menu_user_info);
        mSlcToolBarDelegate.setOnMenuItemClickListener(item -> {
            if (item.getItemId() == R.id.action_pass_word) {
                viewModel.editPassWord();
            }
            return false;
        });
    }
}
